Android Device Monitor启动插件

前言

最近使用Android Studio3.3调试应用过程中,需要使用Android Device Monitor,但是界面上找不到入口,印象中之前的版本是存在的。

官方解释:

Android Device Monitor was deprecated in Android Studio 3.1 and removed from Android Studio 3.2. The features that you could use through the Android Device Monitor have been replaced by new features. The table below helps you decide which features you should use instead of these deprecated and removed features.

官方准备弃用Android Device Monitor 并推荐开发者使用对应的新特性作为替代品。具体查阅[官网]。(https://developer.android.google.cn/studio/profile/monitor) 对于习惯使用Android Device Monitor的开发者来说,每次都需要目录下触发monitor很不方便。所以,用最简单的方式将其集成到Android Studio界面上是相对不错的解决方案。

准备

需求

  • 满足工作环境(Windows, Mac Pro)
  • Android Studio主界面启动
  • 单次配置

源代码

AndroidDeviceMonitorPlugin

plugin.xml

plugin.xml

如果不清楚菜单分组分类,可以去Android Studio 主工具菜单空白处右键查阅

Customize Menus And Toolbars

点击“Customize Menus And Toolbars”,得见下方内容

Menu and Toolbars

SettingsConfigurable

SettingsConfigurable

LaunchMonitorAction

LaunchMonitorAction

总结

  • 第一次开发Intellij Plugin:Java界面开发早已忘却
  • 单纯实现功能,逻辑相对简单,但是插件开发里应该有很多门道
  • 多看官文和成功案例
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×